#include <iostream>
using namespace std;
#include <memory>
class Car;
class Person
{
public:
    Person()
    {
        cout<<"Person()"<<endl;
    }
    ~Person()
    {
        cout<<"~Person()"<<endl;
    }
public:
    shared_ptr<Car>m_car = nullptr;
    // Car * m_car;
};

class Car
{
public:
    Car()
    {
        cout<<"Car()"<<endl;
    }
    ~Car()
    {
        cout<<"~Car()"<<endl;
    }

public:
    weak_ptr<Person>m_person ;
    // Person * m_person;
};

int main()
{

    {
        shared_ptr<Person>person(new Person());
        shared_ptr<Car>car(new Car());
        person->m_car = car;
        cout<<person->m_car.use_count()<<endl;
        cout<<car->m_person.use_count()<<endl;
    }
    // auto val = 100;
    // cout<<typeid(val).name<<endl;
    return 0;
}